<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.ag.contactTree.*"%>
<%@page import="com.ag.zhh.vo.*"%>
<%TreeNode node = (TreeNode)request.getAttribute("node"); 
	
	
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>

		<title></title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link type="text/css" href="/ag/css/dialog/jquery.ui.all.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../zhh/css/formbg.css">
		<link rel="stylesheet" type="text/css" href="../zhh/css/utils.css">
		<!-- 
		<link rel="stylesheet" type="text/css" href="../zhh/css/displayOrNot.css">
		 -->
		<style type="text/css">
		
		#dept
		{
			padding-top:10px;
			padding-left:15px;
			font-size:20px;
			font-weight:100px;
			color:#0287CA;
			margin-bottom:10px;
		/*	background-color:#cccc99;	*/	
		
		}
		#dept div
		{
			margin:3px;
		/*	float:left;*/
		}
		body
		{
			background-color:#dceffd;
		}		
		</style>
		<link rel="stylesheet" type="text/css" href="/ag/zhh/chat/css/leader.css">
		<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.core.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.widget.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.mouse.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.button.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.draggable.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.position.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.resizable.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.ui.dialog.js"></script>
		<script type="text/javascript" src="/ag/js/dialog/jquery.effects.core.js"></script>
		<script type="text/javascript"src="/ag/css/dialog/jquery.bgiframe-2.1.1.js"></script>
		<script type="text/javascript" src="../js/jquery.validate.pack.js"></script> 
		<script type="text/javascript" src="../zhh/js/maintain-validate.js"></script> 
		<script src="../zhh/js/maintain.js" type="text/javascript"></script>
		<!-- 
		<script src="../zhh/js/tab.js" type="text/javascript"></script>
		 -->	
		<script>

</script>
	</head>

	<body>
	<!-- 在页面中隐藏了树的结点id和类型 -->
	<%
		UserDept dept = (UserDept)node.getBindData();
		System.out.println("部门id： "+dept.getUdId()+"  部门名："+dept.getUdName()+" 部门手机："+dept.getUdPhone()+"  部门电话："+dept.getUdTel()+" 部门传真："+dept.getUdFax());
		List<TreeNode> deptChildList = (List<TreeNode>) node.getChildren();
		 String treeType = (String)request.getAttribute("treeType") ; 
	%>
	<input id="treeType" type="hidden" value=<%=treeType %>>
	<input id="nodeId" type="hidden" value=<%=node.getNodeId()%>>

	<!-- 该部门 -->
	
	<div style="width:100%" id="dept">	        
        <div  >部门名:<span id="bname"><%=dept.getUdName()!=null?dept.getUdName():"" %></span></div>
        <div >负责人:<span id="buser" name="<%=dept.getTbUser()!=null?dept.getTbUser().getUId():"noneUser" %>"><%=dept.getTbUser()!=null?dept.getTbUser().getUName():"" %></span></div>           
 		<div  >电话：<span id="btel"><%=dept.getUdTel()!=null?dept.getUdTel():"" %></span></div>         
 		<div  >手机：<span id="bphone"><%=dept.getUdPhone()!=null?dept.getUdPhone():"" %></span></div>
 		<div  >传真：<span id="bfax"><%=dept.getUdFax()!=null?dept.getUdFax():"" %></span></div> 
 		<br/>
 		<%System.out.println("树的类型："+treeType); 
 			System.out.println("page2: 部门 id："+dept.getUdId()+"  部门名："+dept.getUdName()+"  部门手机："+dept.getUdPhone()+"  部门电话："+dept.getUdTel()+"  部门传真："+dept.getUdFax());
 		if(treeType.equals("0001")){%> 
 		<div >是否应急部门:<span><input type="checkbox" class="deptDIf" value="<%=dept.getUdId()%>" <%if((dept.getUdIf()!=null)&&dept.getUdIf()==1){%>  checked="checked" <%}%>></span></div>
 		<%} %>
 			 <!--             
             <td height="18" bgcolor="#FFFFFF"><div align="center" class="STYLE2 STYLE1"><input class="deptDIf" type="checkbox" value="<%=dept.getUdIf() %>"  <%=(dept.getUdIf()!= null )&& (dept.getUdIf()==1)?"checked":" "%>/></div></td>
            -->             
        <div><img src="../tab/images/037.gif" width="9" height="9" /><span class="STYLE1"> [</span><a href="#" class="deptUpdate2"  id="bianji" name="<%=dept.getUdId()%>">编辑</a><span class="STYLE1">]</span><!-- <span ><img src="../tab/images/010.gif" width="9" height="9" /> </span><span class="STYLE1">[</span><a href="#" class="deptDelete" name="<%=dept.getUdId()%>">删除</a><span class="STYLE1">]</span> --></div>          
	</div>
	<br/>
	<div id="deptList" class="noned">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="30"><img src="../tab/images/tab_03.gif" width="15" height="30" /></td>
        <td width="1101" background="../tab/images/tab_05.gif"><img src="../tab/images/311.gif" width="16" height="16" /> <span class="STYLE4"><%=dept.getUdName() %>子部门表</span></td>
        <td width="281" background="../tab/images/tab_05.gif"><table border="0" align="right" cellpadding="0" cellspacing="0">
            <tr>         
              <td width="60">             
              <table width="90%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="STYLE1"><div align="center"><img src="../tab/images/001.gif" width="14" height="14" /></div></td>
                    <td class="STYLE1"><div align="center"><a href="#" id="addDeptLink">新增</a></div></td>
                  </tr>
              </table>           
              </td>            
            </tr>
        </table></td>
        <td width="14"><img src="../tab/images/tab_07.gif" width="14" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" background="../tab/images/tab_12.gif">&nbsp;</td>
        <td bgcolor="#dceffd"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#84b1d3" >
       
          <tr>
            <td width="14%" height="26" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">部门名</div></td>
            <td width="14%" height="26" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">负责人</div></td>
            <td width="14%" height="26" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">部门电话</div></td>
            <td width="14%" height="26" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">部门手机</div></td>
            <td width="14%" height="26" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">部门传真</div></td>
            <%if(treeType.equals("0001")){%>
        	<td width="10%" height="18" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2 STYLE1">是否应急部门</div></td>
        	<%} %>
           	<td width="7%" height="18" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2">编辑</div></td>
            <td width="7%" height="18" background="../tab/images/tab_14.gif" class="STYLE1"><div align="center" class="STYLE2">删除</div></td>
       
          </tr>
  
            <%if(deptChildList != null && deptChildList.size() > 0) {%>
          <%for(TreeNode child:deptChildList){ 
          UserDept childDept = (UserDept)child.getBindData();
    //      System.out.println("是否应急部门： "+childDept.getUdIf());
          %>
          <tr>
          <!-- 部门名 -->
            <td height="18" bgcolor="#FFFFFF"><div  class="STYLE2 STYLE1" ><%=childDept.getUdName()!=null?childDept.getUdName():""%></div></td>
            <!-- 负责人 -->
            <td height="18" bgcolor="#FFFFFF" name="<%=childDept.getTbUser()!=null?childDept.getTbUser().getUId():"noneUser" %>"><div  class="STYLE2 STYLE1" ><%=childDept.getTbUser()!=null?childDept.getTbUser().getUName():""%></div></td>
            <td height="18" bgcolor="#FFFFFF"><div  class="STYLE2 STYLE1" ><%=childDept.getUdTel()!=null?childDept.getUdTel():""%></div></td>
            <td height="18" bgcolor="#FFFFFF"><div  class="STYLE2 STYLE1" ><%=childDept.getUdPhone()!=null?childDept.getUdPhone():""%></div></td>
            <td height="18" bgcolor="#FFFFFF"><div  class="STYLE2 STYLE1" ><%=childDept.getUdFax()!=null?childDept.getUdFax():""%></div></td>    
            <%if(treeType.equals("0001")) {%>          
            <td height="18" bgcolor="#FFFFFF" align="center"><div  ><input type="checkbox" class="deptDIf" value="<%=childDept.getUdId()%>" <%if((childDept.getUdIf()!=null)&&childDept.getUdIf()==1){%>  checked="checked" <%}%>></div></td>
            <%} %>
            <td height="18" bgcolor="#FFFFFF"><div align="center"><img src="../tab/images/037.gif" width="9" height="9" /><span class="STYLE1"> [</span><a href="#" class="deptUpdate" name="<%=childDept.getUdId() %>">编辑</a><span class="STYLE1">]</span></div></td>
            <td height="18" bgcolor="#FFFFFF"><div align="center"><span class="STYLE2"><img src="../tab/images/010.gif" width="9" height="9" /> </span><span class="STYLE1">[</span><a href="#" class="deptDelete" name="<%=childDept.getUdId()%>">删除</a><span class="STYLE1">]</span>--</div></td>
          
          </tr>
         
          <%} }%>

          </table></td>
        <td width="9" background="../tab/images/tab_16.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="29"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="15" height="29"><img src="../tab/images/tab_20.gif" width="15" height="29" /></td>
        <td background="../tab/images/tab_21.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="25%" height="29" nowrap="nowrap"><span class="STYLE1"></span></td>
            <td width="75%" valign="top" class="STYLE1"><div align="right">
            <!-- 有注释 -->
            <%if(treeType.equals("0001")){%>
              <table width="90" height="20" border="0" cellpadding="0" cellspacing="0">
                <tr>
                 <td width="30" height="22" valign="middle"><input type="button" id="but-setdeptdifs-submit" value="保存"/></td>
                   <td width="30" height="22" valign="middle"><input type="button" class="cancelbutton" value="取消"></input></td>
                </tr>
              </table>
              <%}%>
            </div></td>
          </tr>
        </table></td>
        <td width="14"><img src="../tab/images/tab_22.gif" width="14" height="29" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>


<div id="addedit" class="noned" style="">
<form id="deptform">
<input type="hidden" id="udId" name="udId">
<table border="0">
	<tr width="100%">
		<td>部门名</td><td><input type="text" name="deptName" id="deptName"/></td>
	</tr>
	<tr>
		<td>负责人<input type="hidden" id="leader" value=""/></td>
		<td><input id="leaderName" name="leaderName" type="text"/>
				<select id="myusers"  style="display:none">
						<option value="" class="one" >&nbsp;&nbsp;姓名&nbsp;&nbsp;电话&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机&nbsp;&nbsp;</option>		
				</select>			
					
		</td>
	</tr>
	
	<tr>
	</tr>
	<tr>
		<td>联系电话</td><td><input id="udTel" name="udTel" type="text"/></td>
	</tr>
	<tr>
		<td>联系手机</td><td><input id="udPhone" name="udPhone" type="text"/></td>
	</tr>
	<tr>
		<td>联系传真</td><td><input id="udFax" name="udFax" type="text"/></td>
	</tr>
	<tr ><td><input type="submit" value="提交"/></td><td><input type="button" value="取消" id="cal"/></td></tr>
</table>	
</form>
</div>
<div title="删除" id="delete">
</div>
<div id="msgdialog" title="信息" align="center">
		</div>
	</body>
</html>

